/**
 Copyright will be fixed soon.
 Author: Hiroshi Ota.
 $Date: $
 $Revision: $
*/

#ifndef _BF_ARGORITHM_CONTAINER_H_
#define _BF_ARGORITHM_CONTAINER_H_

#include "BFPathRecognizer.h"
#include "BFDriveControl.h"
#include "IBFArgorithm.h"

class BFArgorithmContainer
{
public:
	// when you use this signature constructor, you should call updateContainerSize() before using this class functions
	BFArgorithmContainer();

	BFArgorithmContainer(int noOfPathRecognizer, int noOfDriveControl);
	// Before call this, client should delete whole registed argorithm instances
	~BFArgorithmContainer(void);

	void updateContainerSize(int noOfPathRecognizer, int noOfDriveControl);

	void setStrategy(IBFArgorithm* argo) { strategy = argo; }
	int registPathRecognizer(BFPathRecognizer* argo) {
		pathRecognizers[noOfPathRecognizer] = argo;
		return noOfPathRecognizer++;
	}
	int registDriveControl(BFDriveControl* argo) {
		driveControls[noOfDriveControl] = argo;
		return noOfDriveControl++;
	}

	IBFArgorithm* getStrategy() { return strategy; }
	BFPathRecognizer* getPathRecognizer(int key) { return pathRecognizers[key]; }
	BFDriveControl* getDriveControl(int key) { return driveControls[key]; }

	int getPathRecognizerMaxSize() { return this->maxOfPathRecognizer; }
	int getDriveControlMaxSize() { return this->maxOfDriveControl; }

	int getRegistedPathRecognizerNo() { return this->noOfPathRecognizer; }
	int getRegistedDriveControlNo() { return this->noOfDriveControl; }

protected:
	IBFArgorithm* strategy;
	int noOfPathRecognizer;
	int maxOfPathRecognizer;
	BFPathRecognizer** pathRecognizers;
	int noOfDriveControl;
	int maxOfDriveControl;
	BFDriveControl** driveControls;
};

#endif // _BF_ARGORITHM_CONTAINER_H_
